package com.aynu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author mj
 * @version 1.0
 * @date 2021/3/14 23:41
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 修改配置，让指定路径返回指定的页面
     * 视图映射，添加视图跳转逻辑
     * @param registry
     */
//    @Override
//    public void addViewControllers(ViewControllerRegistry registry) {
//        registry.addViewController("/login.html").setViewName("login");
//        registry.addViewController("/register.html").setViewName("register");
//    }


    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
//        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/register.html").setViewName("register");
    }
}
